<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/inc/taglib.jsp"%>
<
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin.pro.iframe/css/H-ui.login.min.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/lib/Hui-iconfont/1.0.9/iconfont.css" />
<title>OSSJK管理后台 v1.1</title>
</head>
<body>
	<input type="hidden" id="TenantId" name="TenantId" value="" />
	<div class="header"></div>
	<div class="loginWraper">
		<div id="loginform" class="loginBox">
			<form id="form" class="form form-horizontal" action="${pageContext.request.contextPath}/system/index.do?method=login" method="post">
				<div class="row clearfix">
					<label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
					<div class="form-controls col-xs-8">
						<input  name="name" type="text" placeholder="账户" class="input-text size-L" id="name">
					</div>
				</div>
				<div class="row clearfix">
					<label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
					<div class="form-controls col-xs-8">
						<input  name="pwd" type="password" placeholder="密码" class="input-text size-L" id="pwd">
					</div>
				</div>
				<input type="checkbox" name="rem" value="1" id="rem" >记住密码<br><br>
		<!-- 验证码开始 -->
				<div class="row clearfix">
					<label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
					<div class="form-controls col-xs-8">
						<input  name="yzm" type="text" placeholder="验证码" height="41" size="10px">
						&nbsp;&nbsp;&nbsp;<img alt="验证码" src="${pageContext.request.contextPath}/imgs/image.jsp" id="img">
					</div>
				</div>
		<!-- 验证码结束 -->	
			
				<div class="row clearfix">
					<div class="form-controls col-xs-8 col-xs-offset-3">
						<input name="" type="submit" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
						<input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
					</div>
				</div>
				<div class="row clearfix">
					<div class="formControls col-xs-8 col-xs-offset-3">
						<label for="online" style="color: red"> ${requestScope.msg }</label>
					</div>
				</div>
			</form>
		</div>
	</div>
	<div class="footer">Copyright OSSJK by h-ui.admin.pro.iframe v1.0</div>
	<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/h-ui/js/H-ui.min.js"></script>
	<!-- 验证js -->
	<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery.validation/1.14.0/validate-methods.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery.validation/1.14.0/messages_zh.js"></script>
	<script type="text/javascript">
	
		$("#form").validate({
			rules : {
				name : {
					required : true,
				},
				pwd : {
					required : true,
				}
			}
		});
	$(function(){
		
		$("#img").click(function () {
			$("#img").attr("src","${pageContext.request.contextPath}/imgs/image.jsp?s=" + new Date());
		})
		
		 //拿到cookie
		  var name = getCookie("name");
		  var pwd = getCookie("pwd");
		  //alert(name);
		  if(name){//判断uid是否为空
			 $("#name").val(name);//把cookie放到输入框里面
			 $("#pwd").val(pwd);
			 $("#rem").attr('checked',true)//保持选择的状态
		  }
		  //设置cookie
	      function setCookie(name,value,day) {
	          var date = new Date();
	          date.setDate(date.getDate()+day); //保证每次操作完，cookie有效时间都重新计算
	          document.cookie = name+'='+value+';expires'+date;
			}
	     //获取cookie
	     function getCookie(name) {
			var reg = RegExp(name + '=([^;]+)');///正则表达式
			var arr = document.cookie.match(reg);
			if (arr) {///判断数组是否为空
				return arr[1];///返回数组下标是1的值
			} else {
				return '';
			}
		};
		//删除cookie
		function delCookie(name) {
			setCookie(name, null, -1);///把值设置成null
		};
	   });
			
	</script>
</body>
</html>
